//
//  EnergyListVC.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/26.
//

#import "EnergyListVC.h"
#import "EnergyNoneListView.h"
#import "EnergyAttendListView.h"
#import "EnergyFinishListView.h"

@interface EnergyListVC ()
@property (nonatomic,strong) UIImageView * infoView;
@property (nonatomic, strong) JXCategoryTitleView   * myCategoryView;
@property (nonatomic,strong) UIScrollView * contentView;
@property (nonatomic,strong) EnergyNoneListView * noneView;
@property (nonatomic,strong) EnergyAttendListView * attendView;
@property (nonatomic,strong) EnergyFinishListView * finishView;
@end

@implementation EnergyListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setSubViewLayout];
}

-(void)setSubViewLayout{
    
    [self.view addSubview:self.infoView];
    [self.view addSubview:self.myCategoryView];
    [self.view addSubview:self.contentView];
    
    [self.contentView addSubview:self.noneView];
    [self.contentView addSubview:self.attendView];
    [self.contentView addSubview:self.finishView];
    
}
-(UIImageView *)infoView{
    
    if(!_infoView){
        _infoView = [[UIImageView alloc]initWithFrame:CGRectMake(0, NavHeight, WIDTH, 57 * FMScaleX)];
        _infoView.image = [UIImage imageNamed:@"Energy_info_icon"];
    }
    return _infoView;
}

-(JXCategoryTitleView *)myCategoryView{
    
    if (!_myCategoryView) {
        _myCategoryView = [[JXCategoryTitleView alloc]initWithFrame:CGRectMake(5, GETMaxY(self.infoView) + 10 * FMScaleX, WIDTH, 40)];
        _myCategoryView.titles = @[@"未开奖",@"已参与",@"已开奖"];
        _myCategoryView.titleColor = RDRGB(0x666666);
        _myCategoryView.titleSelectedColor = RDRGB(0xAD7D62);
        _myCategoryView.titleLabelZoomScale = 1.2;
        _myCategoryView.titleLabelZoomEnabled = YES;
        _myCategoryView.contentScrollView = self.contentView;
        _myCategoryView.titleSelectedFont = Semibold(14);
        _myCategoryView.titleFont = Regular(14);
        
        JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
        lineView.indicatorColor = RDRGB(0xAD7D62);
        lineView.indicatorWidth = 20 * FMScaleX;
        lineView.indicatorHeight = 3;
        _myCategoryView.indicators = @[lineView];
    }
    return _myCategoryView;
}
-(UIScrollView *)contentView{
    
    if (!_contentView) {
        _contentView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, GETMaxY(self.myCategoryView) +1, WIDTH, HEIGHT - NavHeight - 85 * FMScaleX - safaHeight - TabBarHeight - 67 * FMScaleX)];
        _contentView.backgroundColor = UIColor.clearColor;
        _contentView.contentSize = CGSizeMake(WIDTH * 3, _contentView.getHeight);
        _contentView.showsVerticalScrollIndicator = NO;
        _contentView.showsHorizontalScrollIndicator = NO;
        _contentView.bounces = NO;
        _contentView.pagingEnabled = YES;
    }
    return _contentView;
}
-(EnergyNoneListView *)noneView{
    
    if (!_noneView) {
        _noneView = [[EnergyNoneListView alloc]initWithFrame:CGRectMake(0, 0, _contentView.getWidth, _contentView.getHeight)];
    }
    return _noneView;
}
-(EnergyAttendListView *)attendView{
    
    if (!_attendView) {
        _attendView = [[EnergyAttendListView alloc]initWithFrame:CGRectMake(WIDTH, 0, _contentView.getWidth, _contentView.getHeight)];
    }
    return _attendView;
}
-(EnergyFinishListView *)finishView{
    
    if (!_finishView) {
        _finishView = [[EnergyFinishListView alloc]initWithFrame:CGRectMake(WIDTH * 2, 0, _contentView.getWidth, _contentView.getHeight)];
    }
    return _finishView;
}
@end
